package com.Test;

import java.util.HashMap;
import java.util.LinkedHashMap;

/**
 * Description:
 * Copyright:   Copyright (c)2019
 * Company:     zefu
 *
 * @author: 张李鑫
 * @version: 1.0
 * Create at:   2022-02-08 15:58:02
 * <p>
 * Modification History:
 * Date         Author      Version     Description
 * ------------------------------------------------------------------
 * 2022-02-08     张李鑫                     1.0         1.0 Version
 */
public class T {


    public void print(String name) throws InterruptedException {
        System.out.println(name);
        Thread.sleep(1000);
        System.out.println(name + "休眠结束");
    }


    public static void main(String[] args) {
        LinkedHashMap<String, String> stringStringLinkedHashMap = new LinkedHashMap<>();

        stringStringLinkedHashMap.put("4","1");
        stringStringLinkedHashMap.put("2","1");
        stringStringLinkedHashMap.put("3","1");
        stringStringLinkedHashMap.put("1","1");

        stringStringLinkedHashMap.forEach((key,value)->{
            System.out.println(key);
//            System.out.println(value);
        });

        HashMap<String, String> map = new HashMap<>();
        map.put("4","1");
        map.put("2","1");
        map.put("3","1");
        map.put("1","1");

        map.forEach((key,value)->{
            System.out.println(key);
        });
    }

}
